Skip to content

refactor(installer): unify Vite+ setup into the global cli - #2611

Open
liangmiQwQ wants to merge 21 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/refactor-installer
Open

refactor(installer): unify Vite+ setup into the global cli#2611
liangmiQwQ wants to merge 21 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/refactor-installer

Conversation

@liangmiQwQ

@liangmiQwQ liangmiQwQ commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Close #2406
Close #2338
Close #2170

Bash installer, PowerShell installer, vp-setup.exe, and vp upgrade now share the target binary's setup code. Moving installation logic into vp reduces duplication and platform differences, and lets each new version own its setup changes.

Installers download and verify the target, then let it install itself. A completion marker makes setup run on first launch and retry after failure. This also lets old vp upgrade reach the new setup through its existing vp env setup --refresh call, while keeping its download and activation flow.

Setup always creates vpx and vpr shims, uses system-first mode when users decline Node.js management, and reports failures back to the installers.

Installers probe for self-setup support and fall back to the legacy implementations for older targets. Keeping those legacy installers accounts for the net line increase, even though the new scripts are much smaller (reduce more than 2500 line).

Here, “new” and “old” refer to the installers and vp implementations after and before this change. This PR does not change setup-vp. 🟢 indicates a supported compatibility path; it does not imply that every historical version combination has been tested.

Scenario Compatibility mechanism Status
Upgrade an existing Vite+ installation using the new install script The target binary installs itself, reuses the existing installation directory, and updates dependencies, current, and shims. 🟢
New install script → new vp Probes for vite-plus-self-setup-v1, then hands installation over to the target binary. 🟢
New install script → old vp Falls back to the retained legacy installer when the target does not support self-setup. 🟢
Old install script → new vp The old script’s existing env setup invocation triggers the new binary’s first-start setup. 🟢
Old vp upgrade → new vp The existing env setup --refresh call triggers in-place setup, preserving configuration and rollback history. 🟢
New vp upgrade → new vp, including same-version reinstalls Clears the target’s completion marker, then triggers setup through the refresh call. 🟢
Rollback between versions 0.3.0 and later Switches current and refreshes the environment through env setup --refresh. 🟢
setup-vp calling the new install script Preserves directory variables returned by source/dot-source. Calls that do not declare directory awareness default to ~/.vite-plus, keeping PATH consistent. 🟢
New vp-setup.exe → versions 0.3.0 and later Hands installation over to the target binary when self-setup is supported; otherwise uses the Rust legacy installer. 🟢

🤖 Generated with Codex

@netlify

netlify Bot commented Sep 5, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 8f1ee79
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a9d7c515d62f10008c2d414

@liangmiQwQ liangmiQwQ added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests test: sfw labels Sep 5, 2026
@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T11:50:25.849290Z 4179d59 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 072785da3c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vp_global_cli/src/self_setup.rs Outdated
Comment thread crates/vp_global_cli/src/self_setup.rs Outdated
Comment thread packages/cli/install.ps1
Comment thread crates/vp_global_cli/src/self_setup.rs
@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95c99baec5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vp_global_cli/src/self_setup.rs
Comment thread crates/vp_global_cli/src/commands/upgrade/mod.rs
Comment thread crates/vp_global_cli/src/self_setup.rs
@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 013777b09d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vp_global_cli/src/self_setup.rs Outdated
Comment thread crates/vp_global_cli/src/self_setup.rs
Comment thread crates/vp_installer/src/main.rs
@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 4179d59433

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@liangmiQwQ
liangmiQwQ marked this pull request as ready for review September 5, 2026 13:48
@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

One left problem might be #1338 (comment), but it is not a big deal, this PR already copies the original behavior, this could be reconsidered after this merged.

@liangmiQwQ
liangmiQwQ requested a review from fengmk2 September 5, 2026 13:52
@liangmiQwQ liangmiQwQ changed the title refactor(installer): delegate installation to target binary self-setup refactor(installer): unify Vite+ setup into the global CLI Sep 5, 2026
@liangmiQwQ liangmiQwQ changed the title refactor(installer): unify Vite+ setup into the global CLI refactor(installer): unify Vite+ setup into the global cli Sep 5, 2026
@fengmk2 fengmk2 added the preview-build Publish this PR's commits to the registry bridge as preview builds label Sep 5, 2026
@fengmk2

fengmk2 commented Sep 5, 2026

Copy link
Copy Markdown
Member

@liangmiQwQ Can you describe whether all the various compatibility issues after this change have been taken into account? For example, whether users who have upgraded from the old version using Vite+ via the new install.sh are compatible. Or whether the new and old versions of setup-vp are compatible with install.sh, etc.

@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

CI failing is fixed in #2616

@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@liangmiQwQ Can you describe whether all the various compatibility issues after this change have been taken into account? For example, whether users who have upgraded from the old version using Vite+ via the new install.sh are compatible. Or whether the new and old versions of setup-vp are compatible with install.sh, etc.

@fengmk2 I have intentionally considered compatibility issues during this refactor. Detailed compatibility table is included in the PR description.

@fengmk2 fengmk2 self-assigned this Sep 6, 2026
@fengmk2 fengmk2 added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Sep 6, 2026
@liangmiQwQ liangmiQwQ added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Sep 6, 2026
@liangmiQwQ liangmiQwQ added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Registry bridge build (8f1ee79)

Warning

This build is from the fork liangmiQwQ/vite-plus and has not been reviewed.
Installing it runs that code on your machine. Build log

This commit build is published to the registry bridge, which serves these as ordinary npm versions (every other package proxies to npmjs):

Package Version
vite-plus 0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c
@voidzero-dev/vite-plus-core 0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c

Install the Vite+ CLI built from this commit, then migrate a project:

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/liangmiQwQ/vite-plus/8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c/packages/cli/install.sh | VP_PR_VERSION=2611 bash
# Windows (PowerShell)
$env:VP_PR_VERSION="2611"; irm https://raw.githubusercontent.com/liangmiQwQ/vite-plus/8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c/packages/cli/install.ps1 | iex

Or download the standalone Windows installer built from this commit:

Architecture Installer
x64 vp-setup-x86_64-pc-windows-msvc.exe
Arm64 vp-setup-aarch64-pc-windows-msvc.exe

GitHub requires you to sign in and downloads each installer as a ZIP artifact. Extract vp-setup.exe, then run it against this preview build:

.\vp-setup.exe --version "0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c" --registry "https://registry-bridge.viteplus.dev/"

After installing, upgrade the current project's vite-plus to this test build with:

vp migrate

Or point your package manager at the bridge registry https://registry-bridge.viteplus.dev/:

Package manager Registry config
npm / pnpm / Bun .npmrc: registry=https://registry-bridge.viteplus.dev/
Yarn (v2+) .yarnrc.yml: npmRegistryServer: "https://registry-bridge.viteplus.dev/"

Then pin the build (vite aliases to vite-plus-core; pnpm can use a catalog, npm an overrides entry):

{
  "devDependencies": {
    "vite-plus": "0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c",
    "vite": "npm:@voidzero-dev/vite-plus-core@0.0.0-commit.8f1ee79aa9f7e49e26fa55eca1cc03c2d8088b2c"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview-build Publish this PR's commits to the registry bridge as preview builds test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: sfw

Projects

None yet

2 participants